package com.self.oss.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantPropertyUtils implements InitializingBean {

    //读取配置文件的oss四个常量
    @Value(value = "${aliyun.oss.file.endpoint}")
    private String endPoint;

    @Value(value = "${aliyun.oss.file.bucketname}")
    private String bucketName;

    @Value(value = "${aliyun.oss.file.keyid}")
    private String keyId;

    @Value(value = "${aliyun.oss.file.keysecret}")
    private String keySecret;

    public static String END_POINT;
    public static String BUCKET_NAME;
    public static String KEY_ID;
    public static String KEY_SECRET;


    @Override
    public void afterPropertiesSet() throws Exception {

        END_POINT = endPoint;
        BUCKET_NAME = bucketName;
        KEY_ID = keyId;
        KEY_SECRET = keySecret;

    }
}
